#include<iostream>
#include<memory>
using namespace std;

class myclass{
public:
    int a=5;
    int b=5;
    myclass(){}
    myclass(int a,int b):a(a),b(b){};
    ~myclass(){
        cout<<"this is destory_func"<<endl;
    }
};
int main(){
    unique_ptr<myclass>pu(new myclass());
    cout<<(*pu).a<<" "<<pu->b<<endl;
    myclass* newmy=new myclass(7,8);
    pu.reset(newmy);
    cout<<(*pu).a<<" "<<pu->b<<endl;
    pu.reset();
    if(pu){
        cout<<"the pu is notnull"<<endl;
    }
    else{
        cout<<"the pu is null"<<endl;
    }
    return 0;
}